<template>
  <div>
    <key-person-search @getKeyPersonList="getKeyPersonList"/>
    <key-person-list :dataList="dataList"/>
    <div class="pagination-box">
      <el-pagination
        @current-change="handleCurrentChange"
        layout="total, prev, pager, next"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
import keyPersonSearch from './search';
import keyPersonList from './list';
export default {
  name: 'keyPerson',
  components: {
    keyPersonSearch,
    keyPersonList
  },
  data() {
    return {
      table: {
        currentPage: 1,
        pageSize: 10
      },
      dataList: [],
      total: 100
    };
  },
  created() {
    this.getKeyPersonList();
  },
  methods: {
    handleCurrentChange() { },
    search() {
      console.log(this.params);
    },
    async getKeyPersonList(param) {
      const res = await this.$services.get({
        type: 'KEYPERSON',
        url: 'getKeyPersonList',
        params: param
      });
      this.dataList = res.bean.list;
      this.total = res.bean.total;
    }
  }
};
</script>
<style lang="scss" scoped>
</style>
